/***************************************************
> Copyright (C) 2024 ==KINGYI== All rights reserved.
> File Name: 8.5.c
> Author:
> Mail: 
> Created Time: Sun 04 Aug 2024 10:08:48 PM PDT
***************************************************/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>

int main(int argc,const char* argv[])
{
	int fd = 0;
	char buf[100] = {0};
	int ret = 0;

	fd = open("./music/text.txt",O_RDONLY);
	if(fd == -1)
	{
		perror("open");
		exit(-1);
	}
	sleep(10);
	ret = read(fd,buf,sizeof(buf)-1);
	if(ret == -1)
	{
		perror("read");
		exit(-1);
	}
	printf("buf is %s\n",buf);
	close(fd);
	return 0;
}
